from django.conf.urls import url
from rest_framework.routers import DefaultRouter

from . import views

urlpatterns = [
    url(r'^answers/$', views.AnswersListView.as_view()),
    url(r'^answers/(?P<pk>\d+)/$', views.AnswersdetailView.as_view()),
    # 返回所有的标签内容，包括id
    url(r'^answers/labelsdetail/$',views.LabelallView.as_view()),
    # 对评论举报、点赞、踩操作
    url(r'^answers/maincomments/operate/$',views.LikeReportHateView.as_view()),
    # 发表主评论的操作
    url(r'^answers/maincomments/$', views.MainCommentView.as_view()),
    # 发布问题的请求
    url(r'^answers/Quesproduct/$',views.QuesproductView.as_view()),
    # 用户标签关注请求
    url(r'^answers/Labelsatten/$',views.LabelsattenView.as_view()),
    # 用户点击关注请求
    url(r'^answers/Labelsatten/operate/$', views.LabelsattentoView.as_view()),
    # 标签与问题序列化器
    url(r'^answers/LabelQuest/$',views.LabelQuestView.as_view()),


    url(r'^answers/labels/$',views.LabelView.as_view()),
    url(r'^answers/maincomments/user/$', views.UserLikeReportHateView.as_view()),

]

router = DefaultRouter()
router.register('^answers/search',views.AnswersIndexViewset,base_name='answers_search')

urlpatterns += router.urls